{{--<script>--}}
    $('body').on('click', '#add', function() { //新增
        var url =createUrl;
        layer.open({
            type: 2,
            title: '新增数据',
            shadeClose: true,
            shade: 0.8,
            maxmin: true,
            area: ['90%', '90%'],
            content: url,//iframe的url
            end: function(){
                //console.log("2222");
                $('#contentTable').bootstrapTable('refresh');
            }
        });
    }).on('click', 'button.edit-data', function() { // 编辑 edit-data  layer实现编辑文章
        var url = editUrl.replace('__id__',$(this).val()); //this代表删除按钮的DOM对象;
        layer.open({
            type: 2,
            title: '编辑数据',
            shadeClose: true,
            shade: 0.8,
            maxmin: true,
            area: ['90%', '90%'],
            content: url, //iframe的url
            end: function(){
                //console.log("2222");
                $('#contentTable').bootstrapTable('refresh');
            }
        });
    }).on('click', 'button.del-data', function() { // 删除
        var url = deleteUrl.replace('__id__',$(this).val()); //this代表删除按钮的DOM对象;
        layer.confirm('你确定要将该信息删除吗？', {
            btn: ['确定', '取消'],
            icon: 2,
        },function(index){ //index代表当前的弹窗?? //1
            $.ajax({
                //type: "DELETE",
                type: "POST",
                url: url,
                success: function(data){
                    console.log(data);
                    console.log(data.code);
                    if (data.code == 200){
                        //刷新dt
                        console.log('刷新dt');
                        $('#contentTable').bootstrapTable('refresh');
                        //layer.msg(data.result);
                    }
                     console.log(index);
                    layer.close(index); //关闭laravel弹出框
                    layer.msg(data.result);

                }

            });

        });
    }).on('click', 'button.show-data', function() { //查看
        var url = showUrl.replace('__id__',$(this).val()); //this代表删除按钮的DOM对象;
        layer.open({
            type: 2,
            title: '信息查看',
            shadeClose: true,
            shade: 0.8,
            maxmin: true,
            area: ['90%', '90%'],
            content: url //iframe的url
        });
    }).on('click', 'button.handle-data', function() { //数据处理
        var url = handleUrl.replace('__id__',$(this).val()); //this代表删除按钮的DOM对象;
        layer.open({
            type: 2,
            title: '数据处理',
            shadeClose: true,
            shade: 0.8,
            maxmin: true,
            area: ['90%', '90%'],
            content: url //iframe的url
        });
    });
    {{--</script>--}}
